package models

import (
	"time"

	. "gddgame.cc/galaxy/common/dsl/db"
	"gddgame.cc/galaxy/utils/orm"
)

var (
	AppLeaderboardModel = orm.NewModel("app_leaderboard", &AppLeaderboard{}, nil)
)

func init() {
	AddTable(&Table{
		Model: AppLeaderboardModel,
	})
}

type StatOrder byte

const (
	AscOrder StatOrder = iota
	DescOrder
)

type AppLeaderboard struct {
	Id       int    `json:"id" orm:"auto" sql:"INT"`
	AppId    int    `json:"app_id" sql:"INT"`
	Name     string `json:"name" sql:"VARCHAR"`
	Identity string `json:"identity" sql:"VARCHAR"`
	Asc      bool   `json:"asc" sql:"TINYINT"`
	Current  bool   `json:"current" sql:"TINYINT"`

	CreateTime *time.Time `json:"create_time" orm:"createTime" sql:"DATETIME"`
	UpdateTime *time.Time `json:"update_time" orm:"updateTime" sql:"DATETIME"`
}
